package com.lb.shopguide.adapter.viewpager;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import com.lb.shopguide.entity.TutorTypeBean;
import com.lb.shopguide.ui.fragment.guide.miji.FragmentMijiList;

import java.util.List;

/**
 * Created by kang on 2017/6/3.
 */

public class AdapterMijiType extends FragmentPagerAdapter {

    private List<TutorTypeBean> listTypes;

    public AdapterMijiType(FragmentManager fm, List<TutorTypeBean> list) {
        super(fm);
        this.listTypes = list;
    }

    @Override
    public Fragment getItem(int position) {
        return FragmentMijiList.newInstance(listTypes.get(position));
    }

    @Override
    public int getCount() {
        return listTypes.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return listTypes.get(position).getTutorName();
    }
}
